import request from "@/utils/request";
import { ParseData } from "@/utils/utils";

// 获取会员列表分页
export const GetMemberList = (data: any) => {
  return request({
    method: "GET",
    url: `/huiyuan`,
  });
};
// 会员编辑查询
export const GetMemberInfo = (data: any) => {
  return request({
    method: "GET",
    url: `/huiyuan/${data.id}`,
  });
};
// 会员权益修改
export const EditMember = (data: any) => {
  return request({
    method: "PUT",
    data,
    url: `/huiyuan`,
  });
};
// 购买记录 当前会员收费
export const Order = (data: any) => {
  return request({
    method: "GET",
    url: `huiyuan/goumaijilushoufei?huiyuanleixing=${data.type}`,
  });
};
// 购买记录列表
export const GetOrderList = (data: any) => {
  return request({
    method: "GET",
    url: `/huiyuan/goumaijilu?${ParseData(
      data
    )}`,
  });
};
// 会员记录列表
export const GetMemberOrderList = (data: any) => {
  return request({
    method: "GET",
    url: `/huiyuan/shenqingjilu?${ParseData(data)}`,
  });
};
// 会员记录
export const GetMemberOrderDetail = (data: any) => {
  return request({
    method: "GET",
    url: `/huiyuan/shenqingjilu/${data.id}`,
  });
};
// 修改会员记录
export const EditMemberOrder = (data: any) => {
  return request({
    method: "PUT",
    data,
    url: `/huiyuan/shenqingjilu`,
  });
};
